<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>My WebAssembly App</title>
  <script src="./wasm_exec.js"></script>
  <script>
    const go = new Go()
    const importObject = go.importObject
    WebAssembly.instantiateStreaming(fetch('./test.wasm'), importObject)
      .then(
        result => {
          go.run(result.instance);
          console.log( result.instance.exports);
          // const ret = result.instance.exports.CalcFileId("aaa", "bbb");
          const f = new Function('fpath', 'cipher', 'return CalcFileId(fpath,cipher);');
          const ret = f('aaaaaaa','bbbbbbbbbb');

          console.log('Result of adding:', ret);
        }
      )
    // .then((res) => {
    //   console.log(res.instance.exports);
    //   // res.instance.exports.CalcFileId("aa","bb");
    // })
  </script>
</head>

<body></body>

</html>